package com.hk.springtrains.jms.receive;

import com.hongkang.springtrains.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.stereotype.Component;

@Component
public class ReceiveBehaviorImpl implements ReceiveBehavior {

    @Autowired
    private JmsTemplate jmsTemplate ;

    @Override
    public User receiveUserInfo() {
        User user = (User) jmsTemplate.receiveAndConvert();
        return user;
    }
}
